#include "Config.h"

int Config::init()
{
    fstream file;
    file.open(CONFIGNAME, ios::in);
    string key, value;
    string tempStr;
    while(file >> key)
    {
        file >> value;
        m_name2ValueMap[key] = value;
    }

}


int Config::getIntValue(string n)
{
   map<string,string>::iterator itr = m_name2ValueMap.find(n);
   string res = itr->second;
   int iRes = atoi(res.c_str());
   return iRes;
}

string Config::getStrValue(string n)
{
       map<string,string>::iterator itr = m_name2ValueMap.find(n);
       string res = itr->second;
       return res;
}
